Strict

Import agfx

Global myTmpScreen:TTmpScreen

Class TAgfx_test_app Extends TFramework

	Method OnCreate:Int()
		
		Super.OnCreate()
				
		myTmpScreen = New TTmpScreen		
		myTmpScreen.Prepare()
		
		Return 0
	End
	
End

Global tt:Int = 0

Class MyEvent Extends TCallback

	Method Call:Void()
		tt+=1
		Print(tt)
	End
End

Class TTmpScreen Extends TScreen
	
	Field event:TEventTimer

	' START when app is created
	Method Start:Void()
		Self.event = New TEventTimer()
		Self.event.SetTime(2000)
		Self.event.Callback = New MyEvent()
		Self.event.Enable()

	End
	
	' main app logic loop update
	Method Update:Void()
		Self.event.Update()
	End
	
	' main app render loop
	Method Render:Void()
		Cls
		
	End
End
